package org.chen.spring.cloud.finchley.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author chensj
 * @date 2020-02-07 22:23
 */
@Configuration
public class RibbonConfig {

    /**
     * 注册一个RestTemplate
     *
     * @return RestTemplate
     * @LoadBalanced 注解表示负载均衡
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
